<?php

/**
 * Description of sfWidgetFormSchemaFormatterDiv
 *
 * @author Tazenda
 */
class sfWidgetFormSchemaFormatterVoting extends sfWidgetFormSchemaFormatter
{
    protected 
        $rowFormat            = '<div class="voting-form-row span-17 last">
                                    <div class="voting-form-row-field-label span-4">%label%</div>
                                    <div class="voting-form-row-field-input span-13 last">%field%</div>
                                    %help%
                                    %error%
                                    %hidden_fields%
                                 </div>',
        $errorRowFormat        = '',
        $helpFormat            = '<div class="voting-form-help span-17 last">%help%</div>',
        $errorListFormatInARow = '<div class="voting-form-row-error span-17 last">%errors%</div>',
        $errorRowFormatInARow  = "<p>%error%</p>",
        $decoratorFormat       = ' %content%';
    
    public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null)
    {
        $row = parent::formatRow(
            $label,
            $field,
            $errors,
            $help,
            $hiddenFields
        );

        return strtr($row, array('%row_class%' => (count($errors) > 0) ? ' form_row_error' : '',));
    }
}
